package com.btpj.shop.entity;

import java.io.Serializable;
import java.util.Date;

import com.btpj.shop.dto.BannerDto;
import lombok.Data;
import org.springframework.beans.BeanUtils;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * banner
 *
 * @author
 */
@Data
public class Banner implements Serializable {
    /**
     * id
     */
    private Long id;

    /**
     * 轮播图片的Url
     */
    private String url;

    /**
     * 点击后跳转的Url
     */
    private String clickUrl;

    /**
     * 排序值（值越大越靠前）
     */
    private Integer sort;

    /**
     * 是否删除（0：未删除，1:已删除）
     */
    private Boolean isDeleted;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 创建人ID
     */
    private Long createUser;

    /**
     * 更新时间
     */
    private Date updateTime;

    private Long updateUser;

    private static final long serialVersionUID = 1L;

    /**
     * 将Banner转化成BannerDto
     *
     * @return BannerDto
     */
    public BannerDto banner2Dto() {
        BannerDto bannerDto = new BannerDto();
        BeanUtils.copyProperties(this, bannerDto);
        return bannerDto;
    }
}